#ifndef TCP_ACCEPTOR_CONFIG_H
#define TCP_ACCEPTOR_CONFIG_H

#include "io_acceptor_config.h"
#include "tcp_session_config.h"
namespace vpm
{
	namespace mina
	{
		class TcpAcceptorConfig : public IoAcceptorConfig
		{
		public:
			enum TcpAcceptorOptions
			{
				TAO_REUSE_ADDRESS,			
			};

			TcpAcceptorConfig()
			{
				m_tcpAcceptorOptions.set_property(TAO_REUSE_ADDRESS,true);		
			}

			TcpSessionConfig & get_session_config()
			{
				return m_tcpSessionConfig; 
			}

			bool is_reuse_address()
			{
				return m_tcpAcceptorOptions.get_property<bool>(TAO_REUSE_ADDRESS);
			}

			void set_reuse_address(bool flag)
			{
				m_tcpAcceptorOptions.set_property(TAO_REUSE_ADDRESS,flag);
			}


		private:
			TcpSessionConfig m_tcpSessionConfig; 			
			DynamicProperty<int> m_tcpAcceptorOptions;
		};
	}
}

#endif // 
  

